package com.ssy.lingxi.pay.controller.pc;

import com.ssy.lingxi.pay.entity.AliPayNotifyRecord;
import com.ssy.lingxi.pay.service.INotifyRecordService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 状态监测接口
 *
 * @author 伍将
 * @version 2.0.0
 * @date 2020/10/12
 */
@RestController
@RequestMapping("/pay")
public class ServiceStatusController {

    @Resource
    private INotifyRecordService notifyRecordService;

    @RequestMapping("/status")
    public String status() {
        return "OK";
    }

    /**
     * 测试支付宝回调
     * @param params 参数
     */
    @RequestMapping(value = "/test", method = RequestMethod.POST)
    public AliPayNotifyRecord saveAliPayNotifyRecord(@RequestBody Map<String, String> params) {
        System.out.println(params);
        return notifyRecordService.saveAliPayNotifyRecord(params);

    }



}
